//
//  KLVipFuncCell.m
//  Meboo
//
//  Created by kyo on 2024/1/5.
//

#import "KLVipFuncCell.h"

@interface KLVipFuncCell()

@end

@implementation KLVipFuncCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

#pragma mark - Public Metohd
- (void)setModel:(MBVipEquityModel *)model {
    _model = model;
    self.titleLab.text = model.tip;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
}
#pragma mark - Action

#pragma mark - UI
- (void)setupUI {
    self.contentView.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:0.7];
    self.contentView.layer.cornerRadius = MBHeightScale(10);
    
    [self.contentView addSubview:self.iconImageView];
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.mas_equalTo(MBWidthScale(15));
        make.height.width.mas_equalTo(MBHeightScale(33));
    }];
    
    [self.contentView addSubview:self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.iconImageView.mas_right).offset(MBWidthScale(15));
        make.right.mas_equalTo(MBWidthScale(-10));
    }];
}

#pragma mark - Setter && Getter
- (UIImageView *)iconImageView {
    if (!_iconImageView) {
        _iconImageView = [UIImageView new];
        _iconImageView.image = ImageWithName(@"flower_defult");
    }
    return _iconImageView;
}


- (UILabel *)titleLab {
    if (!_titleLab) {
        _titleLab = [UILabel new];
        _titleLab.numberOfLines = 2;
        _titleLab.font = PDRegularScale(18);
        _titleLab.textColor = HEXS(@"000000");
    }
    return _titleLab;
}
@end
